package cn.com.blueInfo.bpm.template.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 执行动作类型
 * @author suxch
 * @since 2025/8/28 22:35
 */
@Getter
@AllArgsConstructor
public enum AutomationRuleExecutionType implements BaseEnum<String> {

    /** 执行动作类型-自动通过 */
    AUTO_PASS("AUTO_PASS", "自动通过"),
    /** 执行动作类型-自动驳回 */
    AUTO_REJECT("AUTO_REJECT", "自动驳回"),
    /** 执行动作类型-自动填充字段 */
    AUTO_FILL("AUTO_FILL", "自动填充字段");

    @EnumValue
    private final String code;

    @JsonValue
    private final String desc;

    public static AutomationRuleExecutionType getByCode(String code) {
        return BaseEnum.getByCode(AutomationRuleExecutionType.class, code);
    }

    @JsonCreator
    public static AutomationRuleExecutionType getByName(String name) {
        return BaseEnum.getByName(name, AutomationRuleExecutionType.class);
    }

}
